﻿<controls:MetroWindow x:Class="SQX.Views.Connection"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
        ShowInTaskbar="False"
        ShowMinButton="False"
        ShowMaxRestoreButton="False"
        ShowIconOnTitleBar="False"
        Title="Connection" Height="210" Width="300" WindowStyle="None" WindowStartupLocation="CenterScreen"
                      BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
                      BorderThickness="1"
                      ResizeMode="NoResize"
                       WindowTransitionsEnabled="False"
                                      >
    <Grid FocusManager.FocusedElement="{Binding ElementName=serverInput}" Background="WhiteSmoke">
        <Label x:Name="conInfo" Content="{Binding Caption}" Margin="0,0,0.333,0" Height="25" VerticalAlignment="Top"
               HorizontalContentAlignment="Center" FontWeight="Bold"/>
        <Label x:Name="serverCaption" Content="Server:" FontWeight="Bold"
               VerticalContentAlignment="Center"            
               Margin="0,30,237.333,0" Height="27" VerticalAlignment="Top" />
        <Label x:Name="dbCaption" Content="Source:" FontWeight="Bold"
               VerticalContentAlignment="Center"            
               Margin="0,62,232.333,0" Height="27" VerticalAlignment="Top" />
        <TextBox x:Name="serverInput" Margin="61,30,10,0" BorderBrush="{x:Null}" Background="#FFF6ECEC" Height="27" VerticalAlignment="Top"
                 VerticalContentAlignment="Center"
                 Text="{Binding ServerName}" PreviewKeyUp="serverInput_PreviewKeyUp"
                 />
        <ComboBox x:Name="dbInput" Margin="61,63,10,0" BorderBrush="{x:Null}" Background="#FFF6ECEC" Height="27" VerticalAlignment="Top"
                 VerticalContentAlignment="Center"
                 Text="{Binding DatabaseName}"
                 ItemsSource="{Binding Databases, Mode=OneWay}"
                  SelectedItem="{Binding DatabaseName}" PreviewKeyUp="dbInput_PreviewKeyUp"
                 />
        <Label x:Name="catalogCaption" Content="Cube:" FontWeight="Bold"
               VerticalContentAlignment="Center" Margin="0,95,232.333,0" Height="27" VerticalAlignment="Top"
               IsEnabled="{Binding CubeComboEnabled}"/>
        <ComboBox x:Name="cubeInput" Margin="61,95,10,0" BorderBrush="{x:Null}" Background="#FFF6ECEC" Height="27" VerticalAlignment="Top"
                 VerticalContentAlignment="Center"
                 Text="{Binding CatalogName}" 
                 ItemsSource="{Binding Cubes}"
                 PreviewKeyUp="cubeInput_PreviewKeyUp"
                 IsEnabled="{Binding CubeComboEnabled}"
                  SelectedItem="{Binding CatalogName}"/>
        <Label x:Name="conStatus" Content="{Binding ConnectionStatus}" Margin="0,127,0,46" HorizontalContentAlignment="Center" />
        <Button x:Name="Connect" Content="Connect" Margin="5,0,200,5" Height="24" VerticalAlignment="Bottom" Click="Connect_Click" />
        <Button Content="Advanced" Margin="103,0,102,5" Height="24" VerticalAlignment="Bottom" />
        <Button x:Name="Cancel" Content="Cancel" Margin="201,0,4,5" Height="24" VerticalAlignment="Bottom" Click="Cancel_Click" />

    </Grid>
</controls:MetroWindow>
